package com.itstyle.seckill.util.statusflow;

import com.alibaba.fastjson.annotation.JSONCreator;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author lifujun
 * @description:
 * @date 2024/2/23 14:44
 */
public enum OrderStatusEnum {
    INIT(1, "初始化"),

    /**
     * 待支付
     */
    WAIT_PAY(0,"待支付"),

    //标准电商

    /**
     * 待发货
     */
    WAIT_SHIPPING(100,"待发货"),

    /**
     * 已发货
     */
    SHIPPED(101,"已发货"),

    /**
     * 部分发货
     */
    PART_SHIPPED(102,"部分发货"),

    //派单核销

    /**
     * 待派单
     */
    WAIT_DISPATCH(200,"待派单"),

    /**
     * 已派单
     */
    DISPATCHED(201,"已派单"),

    /**
     * 待服务
     */
    WAIT_SERVICE(202,"待服务"),

    /**
     * 服务中
     */
    SERVICING(203,"服务中"),

    // 标准核销

    /**
     * 待使用
     */
    UN_EXCHANGE(300,"待使用"),

    // 配送订单
    WAIT_ACCEPT(400,"待接单"),

    WAIT_DELIVER(401,"待配送"),

    DELIVERED(402,"配送中"),

    //公共状态

    /**
     * 交易完成
     */
    DONE(900,"交易完成"),

    /**
     * 交易关闭
     */
    CLOSE(901,"交易关闭"),

    /**
     * 交易完结
     */
    FINISH(902,"交易完结"),

    /**
     * 已退款
     */
    REFUND(903,"退款单");

    /**
     * 状态值
     */
    private final Integer status;

    /**
     * 状态说明
     */
    private final String name;

    OrderStatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    @JsonValue
    public Integer getValue() {
        return this.status;
    }
}